Skip to content

Change climate default limits to constants#14721

Merged
dgomes merged 3 commits intohome-assistant:devfrom
PhilRW:climate-constants
May 31, 2018
Merged

Change climate default limits to constants#14721
dgomes merged 3 commits intohome-assistant:devfrom
PhilRW:climate-constants

Conversation

@PhilRW
Copy link
Copy Markdown
Contributor

@PhilRW PhilRW commented May 31, 2018

Description:

Min and max temp and humidity are now defined in climate __init__.py and are available for import in subclasses.

Checklist:

  • The code change is tested and works locally.
  • Local tests pass with tox. Your PR cannot be merged unless tests pass

Min and max temp and humidity are now defined in climate __init__.py
and are available for import in subclasses.
def max_temp(self):
"""Return the maximum temperature."""
return convert_temperature(35, TEMP_CELSIUS, self.temperature_unit)
return convert_temperature(DEFAULT_MAX_TEMP, TEMP_CELSIUS, self.temperature_unit)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

line too long (89 > 79 characters)

def min_temp(self):
"""Return the minimum temperature."""
return convert_temperature(7, TEMP_CELSIUS, self.temperature_unit)
return convert_temperature(DEFAULT_MIN_TEMP, TEMP_CELSIUS, self.temperature_unit)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

line too long (89 > 79 characters)

def max_temp(self):
"""Return the maximum temperature."""
return convert_temperature(35, TEMP_CELSIUS, self.temperature_unit)
return convert_temperature(DEFAULT_MAX_TEMP, TEMP_CELSIUS, self.temperature_unit)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

line too long (89 > 79 characters)

def min_temp(self):
"""Return the minimum temperature."""
return convert_temperature(7, TEMP_CELSIUS, self.temperature_unit)
return convert_temperature(DEFAULT_MIN_TEMP, TEMP_CELSIUS, self.temperature_unit)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

line too long (89 > 79 characters)

Copy link
Copy Markdown
Contributor

@dgomes dgomes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After addressing the comments LGTM

Comment thread tests/components/climate/test_mqtt.py Outdated
SUPPORT_AWAY_MODE, SUPPORT_AUX_HEAT)
SUPPORT_OPERATION_MODE, SUPPORT_TARGET_TEMPERATURE,
SUPPORT_FAN_MODE, SUPPORT_SWING_MODE, SUPPORT_HOLD_MODE,
SUPPORT_AWAY_MODE, SUPPORT_AUX_HEAT, DEFAULT_MAX_TEMP, DEFAULT_MIN_TEMP)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think changes in this file are not necessary for this PR

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, that's for the other PR.

"""Return the maximum temperature."""
if self._max_temp:
return self._max_temp
# Get default temp from super class
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment can be removed

@dgomes dgomes merged commit 2f1d40e into home-assistant:dev May 31, 2018
@home-assistant home-assistant locked and limited conversation to collaborators Sep 5, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants